
#ifndef TEXTURE_WINDOW
#define TEXTURE_WINDOW

#include "../MyWindow.h"

class TextureWindow : public MyBaseWindow {

	MyButton up_button_;
	cSlot< TextureWindow, int > shift_up_slot_;
	MyButton left_button_;
	cSlot< TextureWindow, int > shift_left_slot_;
	MyButton right_button_;
	cSlot< TextureWindow, int > shift_right_slot_;
	MyButton down_button_;
	cSlot< TextureWindow, int > shift_down_slot_;

	MyButton ro_cw_button_;
	cSlot< TextureWindow, int > ro_cw_slot_;
	MyButton ro_ccw_button_;
	cSlot< TextureWindow, int > ro_ccw_slot_;

	MyButton scale_u_button_;
	cSlot< TextureWindow, int > scale_u_slot_;
	MyButton scale_u_button2_;
	cSlot< TextureWindow, int > scale_u_slot2_;
	MyButton scale_v_button_;
	cSlot< TextureWindow, int > scale_v_slot_;
	MyButton scale_v_button2_;
	cSlot< TextureWindow, int > scale_v_slot2_;

	MyButton reset_button_;
	cSlot< TextureWindow, int > reset_slot_;

	MyButton choose_tex_btn_;
	cSlot< TextureWindow, int > choose_tex_slot_;

	cSlot<TextureWindow, int> sel_changed_slot_;

	MyLinearLayout tex_params_layout_;
	MyEditField sm_gr_edit_field_;
	MyEditField tex_vec00_edit_field_;
	MyEditField tex_vec01_edit_field_;
	MyEditField tex_vec02_edit_field_;
	MyEditField tex_vec03_edit_field_;
	MyEditField tex_vec10_edit_field_;
	MyEditField tex_vec11_edit_field_;
	MyEditField tex_vec12_edit_field_;
	MyEditField tex_vec13_edit_field_;
	MyEditField tex_angle_edit_field_;
	MyEditField tex_id_edit_field_;

	MyLinearLayout tex_sm_angle_layout_;
	MyLinearLayout tex_vec_u_layout_;
	MyLinearLayout tex_vec_v_layout_;

	cSlot<TextureWindow, int, std::string> apply_sm_group_slot_;
	cSlot<TextureWindow, int, std::string> apply_tex_angle_slot_;
	cSlot<TextureWindow, int, std::string> apply_tex_vecs_;


public:
	TextureWindow();
	~TextureWindow();

	int OnClick( float x, float y );
	//int OnMove( float dx, float dy );
	int OnRelease( float x, float y );
	virtual int OnKeyPress( std::vector< unsigned char >& keys );

	void Draw();

	int ShiftTexUp();
	int ShiftTexLeft();
	int ShiftTexRight();
	int ShiftTexDown();
	int RotTexCW();
	int RotTexCCW();
	int ScaleUpU();
	int ScaleDownU();
	int ScaleUpV();
	int ScaleDownV();
	int ResetTexture();
	int ChooseTexture();

	int OnSelectionChange();

	int ApplyTextureChange(std::string str);
	int ApplyTexVecs(std::string str);
	int ApplyTexAngle(std::string str);

};

#endif
